library(tidyverse)
library(DeclareDesign)
library(rdss)

sims <- 2000
bootstrap_sims <- 2000

declaration_21a <-
  declare_model(N = 100,
                U = rnorm(N, sd = 0.2),
                potential_outcomes(Y ~ 0.15 * Z + U)) +
  declare_assignment(Z = complete_ra(N = N, prob = prob)) +
  declare_measurement(Y = reveal_outcomes(Y ~ Z)) +
  declare_estimator(Y ~ Z)

diagnosis_21a <- 
  declaration_21a |> 
  redesign(prob = seq(1 / 12, 11 / 12, length.out = 11)) |> 
  diagnose_designs(sims = sims, bootstrap_sims = bootstrap_sims)

write_rds(diagnosis_21a, file = "diagnosis_objects/diagnosis_21a.rds")
